package edu.kjxy.day02.countPriority;

/**
 * 功能:优先级高的运行的更快
 * 作者:程序员欧阳子韩
 * 日期:2024/2/1 16:03
 */
public class RunTest {
    public static void main(String[] args) {
        try {
            ThreadA a = new ThreadA();
            a.setPriority(Thread.NORM_PRIORITY - 3);
            a.start();
            ThreadB b = new ThreadB();
            b.setPriority(Thread.NORM_PRIORITY + 3);
            b.start();
            Thread.sleep(5000);
            a.stop();
            b.stop();
            System.out.println("a=" + a.getCount());
            System.out.println("b=" + b.getCount());
        }catch (InterruptedException e){
            e.printStackTrace();
        }
    }
}
